package com.isoft.run;

import com.isoft.monitor.FileMonitor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Slf4j
@Component
/*
 * 在项目启动后直接执行文件监听
 * */
public class FileListenerRun implements ApplicationRunner {
    @Autowired
    FileMonitor fileMonitor;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        fileMonitor.moniter();
    }
}
